package 
{
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;	
	import flash.system.fscommand;
	import flash.system.System;
	import main.control.CedModule;
	import main.utils.GetClass;
	import main.utils.LoadResource;		
	
	
	[SWF( backgroundColor = "#E7E5E6", frameRate = "30")]
	 //[SWF( backgroundColor="#666666", frameRate="30")]
	public class CedMain extends Sprite
	{	
		private function onCompleteHandle(evt:Event):void
		{		
			//addChild(_loader);
			_cedModule = new CedModule();
			addChild(_cedModule);	
		}
		
		private function resizeHandler(evt:Event):void
		{
			if (_cedModule)
			{
				_cedModule.width = stage.stageWidth;
				_cedModule.height = stage.stageHeight;
			}
			
			//_cedModule.x = stage.stageWidth / 2;
			//_cedModule.y = stage.stageHeight / 2;
		}
		
		/*private function onEnterFrame(evt:Event):void
		{
			removeEventListener(Event.ADDED_TO_STAGE, onEnterFrame);
			_loader = LoadResource.loadVisualResource("ced.swf", onCompleteHandle);	
		}*/		
		
		public function CedMain()
		{
			//addEventListener(Event.ADDED_TO_STAGE, onEnterFrame);
			_loader = LoadResource.loadVisualResource("ced.swf", onCompleteHandle);	
			fscommand("fullscreen", "true");
			fscommand("showmenu", "false");
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE
			stage.showDefaultContextMenu = false;	
			stage.addEventListener(Event.RESIZE, resizeHandler);
			stage.addEventListener(Event.FULLSCREEN, resizeHandler);		
		}
		
		private var _loader:Loader;
		private var _cedModule:CedModule;	
		
	}
}